Skip to content

Conversation

@tsibley
Copy link
Contributor

@tsibley tsibley commented Nov 3, 2025

See commit messages for details.

Some previews to check out:

Resolves: #1156

Checklist

@nextstrain-bot nextstrain-bot temporarily deployed to nextstrain-s-trs-nextcl-e9eixu November 3, 2025 20:53 Inactive
@tsibley tsibley force-pushed the trs/nextclade-trees branch from 12b5505 to b9c711c Compare November 3, 2025 20:57
@tsibley tsibley temporarily deployed to nextstrain-s-trs-nextcl-e9eixu November 3, 2025 20:57 Inactive
@tsibley
Copy link
Contributor Author

tsibley commented Nov 3, 2025

Two linting errors in CI did not appear locally for me… ah, because I ran npm run lint which is really npm run lint:server and not also npm run lint:static-site. Why is the unqualified "lint" not both?

In any case, the linting didn't like two places I use ! like this:

"some string".split("another string")[0]!

I used the ! because the array index types as string | undefined, which is erroneous: string.split always returns an array of one string element.

I guess I'll tell eslint to go stuff it?

@tsibley tsibley force-pushed the trs/nextclade-trees branch from b9c711c to e1d3693 Compare November 3, 2025 21:05
@tsibley tsibley temporarily deployed to nextstrain-s-trs-nextcl-e9eixu November 3, 2025 21:06 Inactive
@tsibley
Copy link
Contributor Author

tsibley commented Nov 4, 2025

Omit Nextstrain logo for community datasets (although our listings for Groups do not do this yet either)

Illustrated:

image

and the Groups pages with the same issue:

image

@tsibley
Copy link
Contributor Author

tsibley commented Nov 4, 2025

Punting on the logo issue as part of #870 (comment) instead.

@tsibley
Copy link
Contributor Author

tsibley commented Nov 5, 2025

A good conversation about forwards compatibility with Nextclade's index and breaking changes is happening in Slack, started by @ivan-aksamentov.

@victorlin
Copy link
Member

Why is the unqualified "lint" not both?

Reasoning is in cc76309 but I also think it should be both (see 1ebb0a9 in #1076)

@victorlin
Copy link
Member

Planning to pick this up after #1274 is merged.

@victorlin victorlin marked this pull request as draft December 1, 2025 18:23
@victorlin victorlin self-assigned this Dec 1, 2025
Removes the mixed use of a versionDescriptor function param and instance
property in favor of just the instance property.

Moves Resource.versionDescriptor()'s JSDoc where it's supposed to be:
just prior to the method instead of just inside the method.
…subresource() method

This makes .subresources() work as designed (though no behaviour change
is expected).  This change was missed in "sources: Refactor subresource
construction into Resource base class" (ef13cd6), which introduced the
static .Subresource property.
This reverts commit d467229.

I'm in this canonicalization code again for a new source and want to
address the query param handling centrally (rather than proliferate it
further) as mentioned in my original review.¹  Doing so includes going
back to a cleaner pathBuilder interface for routes that don't need
"req".

¹ <#793 (review)>
@victorlin victorlin force-pushed the trs/nextclade-trees branch from e1d3693 to 4bb7fd0 Compare December 2, 2025 22:24
@victorlin victorlin had a problem deploying to nextstrain-s-trs-nextcl-e9eixu December 2, 2025 22:25 Failure
Preserving by default makes more sense for most of our routes, and for
routes where it does not (e.g. /charon/…), adjusting the query via the
callback is now simpler and more declarative like the other routes.

Motivated by being in this canonicalization code again for a new source
and wanting to address the query param handling centrally (rather than
proliferate it further) as mentioned in my original review.¹

No external behaviour change; effectively a different approach to
"Preserve URL queries across redirects" (1c7838a).

¹ <#793 (review)>
The same async wrapper is applied to the Express application instance,
Router instances, and Route instances (i.e. from .route()).  The latter
don't have .use().

Breaks much earlier at runtime (e.g. when setting up routes), crashing
the server, rather than allowing the server to start and erroring on
requests to the affected route.
We use .all() to avoid repeating middleware for each HTTP method on a
route.  I need to start using async middleware in those places.
Useful to be flexible here so the callback can be written less
awkwardly, and necessary to fix a bug (coming soon).
…rent Source

Fixes a subtle bug where changing the dataset *in Auspice* to a
non-canonical path caused a redirection that switched sources, e.g.
staging → core.

For example, if you were on /staging/measles/genome and switched measles
to enterovirus, Auspice made a /charon/getDataset request for
/staging/enterovirus which *should* have canonicalized to
/staging/enterovirus/d68/genome but *was* canonicalized to
/enterovirus/d68/genome.  This was demonstrable by:

    $ curl -IL https://nextstrain.org/charon/getDataset?prefix=/staging/enterovirus -so /dev/null -w '%{url_effective}\n'
    https://nextstrain.org/charon/getDataset?prefix=enterovirus%2Fd68%2Fgenome

Note that the "prefix" query param was missing "staging/".
So we can more easily do external lookups for canonicalization.
So we can more easily construct or lookup the value based on external
information.

I didn't bubble this up to Resource.baseName because it was not
necessary for my purposes, but I wouldn't be surprised if we find a need
to do that in the future.
Missed in "Derive inventory path from key in manifest" (4b2257c).
I will use this in new code that's forthcoming.
…not name

This bug had no visible effect on "core" datasets where the URL path
(e.g. /a/b/c) and name (a/b/c) are equivalent.  For other sources,
however, like "staging", the URL path (e.g. /staging/a/b/c) and name
(a/b/c) differ.  The bug remained latent because historical versions
were only ever enabled for the "core" source.  I noticed when adding UI
for a "nextclade" source that also enabled versions.
…to sort

The "sortingName" was computed for every resource by _sortableName(),
but then not used in the actual sort operations.  Datasets with recency
timeframes (e.g. 2y, 6y, 12y, etc) are now sorted as expected in the UI
instead of being ASCII-betical.
…) construction

Parameterize it so that callers can lump resources in the UI by names
other than the first slash-delimited part of the resource name.  I'll be
using this shortly.
…pName"

I'll be using this shortly to statically sort one set of resource groups
after another.
@victorlin victorlin force-pushed the trs/nextclade-trees branch from 4bb7fd0 to e213c5e Compare December 2, 2025 22:48
@victorlin victorlin temporarily deployed to nextstrain-s-trs-nextcl-e9eixu December 2, 2025 22:48 Inactive
@victorlin victorlin force-pushed the trs/nextclade-trees branch from e213c5e to a679094 Compare December 3, 2025 01:03
@victorlin victorlin had a problem deploying to nextstrain-s-trs-nextcl-e9eixu December 3, 2025 01:04 Failure
The new Nextclade source class and related classes in the
Source/Resource/Subresource framework provide access the "latest"
Nextclade dataset reference trees and resolve a myriad of supported
aliases.

The resource indexer is extended with a new "resource collection" for
Nextclade that essentially transforms the existing Nextclade indexes
into what our resource indexer expects.  This, in turns, fits into
existing resourceIndexer/ and src/resourceIndex.js code to provide
access to historical versions of Nextclade dataset reference trees.
Bumps the resource index version to v9 since changes were made to
resourceIndex/.

The static-site/app/nextclade/… files were largely copied from
static-site/app/staging/… and then modified to refer to the "nextclade"
source instead.  There is a lot of boilerplate and duplication.  But
that appears to be the way it's been done for other usages, and I don't
have time to make it better so close to the eve of my departure.  The
biggest differences are in the resources.tsx file.

Resolves: <#1156>
@victorlin victorlin force-pushed the trs/nextclade-trees branch from a679094 to 4e59d79 Compare December 3, 2025 01:08
@victorlin victorlin temporarily deployed to nextstrain-s-trs-nextcl-e9eixu December 3, 2025 01:09 Inactive
@victorlin
Copy link
Member

Changes have been rebased onto latest master.

Re: e1d3693

The static-site/app/nextclade/… files were largely copied from static-site/app/staging/… and then modified to refer to the "nextclade" source instead. There is a lot of boilerplate and duplication. But that appears to be the way it's been done for other usages, and I don't have time to make it better so close to the eve of my departure.

I've created ##1281 to address this separately. If it looks like a good direction to others, I'll bring those changes into this PR via rebase.

@joverlee521
Copy link
Contributor

I've created ##1281 to address this separately. If it looks like a good direction to others, I'll bring those changes into this PR via rebase.

+1 for this direction!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/nextclade/sars-cov-2 is outdated

5 participants